<template>
  <div class='content'>
    <div  v-if="showl" class="item" @click="Status()">
      <span>暂停服务</span>
      <van-icon name="arrow" class="right" />
    </div>
    <div  v-else class="item" @click="Status1()">
      <span>开启服务</span>
      <van-icon name="arrow" class="right" />
    </div>
    <div class="item" @click="$router.push('/closeService')">
      <span>关闭服务</span>
      <van-icon name="arrow" class="right" />
    </div>
    <van-dialog v-model="show" title="" show-cancel-button confirmButtonText="知道了" confirmButtonColor=“#0064F4”>
      <div class="textdialog">您有未完成的乘车订单</div> 
    </van-dialog>
  </div>
</template>

<script>
import {UserStatus} from "../api"
  export default {
  data() {
    return {
      show: false,
      showl: true
    };
  },
  created () {
    let status =  localStorage.getItem("status")
    console.log(status);
   if(status==2){
      this.showl = false
    }
  },
  methods: {
    Status(){
      this.$router.push("/suspendone")
    },
    Status1(){
      this.$router.push("/suspendtwo")
    },
    go(){
      history.go(-1)
    }
  }, 
};
</script>

<style lang="scss" scoped>
.content {
  font-family: PingFangSC-Regular, PingFang SC;
  box-sizing: border-box;
  height: 100vh;
  background: #F2F2F2;
  padding:15px 12px;
  .header{
    display: flex; 
    background: #FFFFFF;
    margin-bottom: 7px;
    .img1{
      margin: 12px 0 9.5px 15px;
    }
    p{
      width: 72px;
      height: 25px;
      font-size: 18px;
      font-family: PingFangSC-Medium, PingFang SC;
      font-weight: 250;
      color: #333333;
      line-height: 25px;
      margin: 12px 90px 9.5px 90px;
    }
  }
  .textdialog{
    margin: 34px 0;
    text-align: center;
  }
  .item{
    background: #fff;
    border-radius: 8px;
    margin-bottom: 15px;
    padding: 18px 12px;
    font-size: 17px;
    font-weight: 400;
    color: #333;
    display: flex;
    justify-content: space-between;
    .right {
      color: #ccc;
    }
  }
}
</style>